<?php
include '../Core/function.php';
 
if( $_POST ){

	$res = $_POST;

	foreach ($res as $key => $value) {
		if( $value == '' ){
			error('../index.php', '文本框不能为空');
		}
	}

	$db =  include '../database/database.php'; 

	$db[] = $res;

	$allstr = var_export($db,true); 

	$allstr = '<?php return '.$allstr.' ?>';

	file_put_contents('../database/database.php', $allstr);

	success('../index.php','留言成功');

}else{

	error('../index.php','非法访问');

	exit;
}

?>